Drop gdk_surface_withdraw
authorMatthias Clasen <mclasen@redhat.com>
Sun, 15 Jul 2018 19:12:14 +0000 (15:12 -0400)
committerMatthias Clasen <mclasen@redhat.com>
Sun, 15 Jul 2018 19:29:58 +0000 (15:29 -0400)
'withdrawn' is an X11-centric concept, and the function
can just as well be replaced by gdk_surface_hide.

docs/reference/gdk/gdk4-sections.txt
gdk/gdksurface.c
gdk/gdksurface.h
gdk/x11/gdksurface-x11.c
gtk/gtkwindow.c

index 482b7fdbd8a1c7e292eb735eeb567f5589d08901..a3e6543171be3ef35a44d91cb2fedb4da2fdc40e 100644 (file)
@@ -193,7 +193,6 @@ gdk_surface_is_visible
 gdk_surface_is_viewable
 gdk_surface_is_input_only
 gdk_surface_get_state
-gdk_surface_withdraw
 gdk_surface_iconify
 gdk_surface_deiconify
 gdk_surface_stick
index db80d00eb63b8c2a158dbf0a9ac95d8eba6cc28d..00c5ac4c094970d72919575c187b9ed9e23030a5 100644 (file)
@@ -2607,38 +2607,6 @@ G_GNUC_END_IGNORE_DEPRECATIONS
     gdk_surface_invalidate_in_parent (surface);
 }
 
-/**
- * gdk_surface_withdraw:
- * @surface: a toplevel #GdkSurface
- *
- * Withdraws a surface (unmaps it and asks the surface manager to forget about it).
- * This function is not really useful as gdk_surface_hide() automatically
- * withdraws toplevel surfaces before hiding them.
- **/
-void
-gdk_surface_withdraw (GdkSurface *surface)
-{
-  GdkSurfaceImplClass *impl_class;
-  GdkGLContext *current_context;
-
-  g_return_if_fail (GDK_IS_SURFACE (surface));
-
-  if (surface->destroyed)
-    return;
-
-  if (gdk_surface_has_impl (surface))
-    {
-      impl_class = GDK_SURFACE_IMPL_GET_CLASS (surface->impl);
-      impl_class->withdraw (surface);
-
-      current_context = gdk_gl_context_get_current ();
-      if (current_context != NULL && gdk_gl_context_get_surface (current_context) == surface)
-        gdk_gl_context_clear_current ();
-
-      recompute_visible_regions (surface, FALSE);
-    }
-}
-
 static void
 gdk_surface_move_resize_toplevel (GdkSurface *surface,
                                   gboolean   with_move,
index a1b800b8f43f144423c5153f5d19b1bf1374c5e2..b9d88690b5ebcd31ea01eebc30f28e16da220791 100644 (file)
@@ -460,8 +460,6 @@ void          gdk_surface_show                  (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_hide                  (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
-void          gdk_surface_withdraw              (GdkSurface     *surface);
-GDK_AVAILABLE_IN_ALL
 void          gdk_surface_show_unraised         (GdkSurface     *surface);
 GDK_AVAILABLE_IN_ALL
 void          gdk_surface_move                  (GdkSurface     *surface,
index f04f74d4868fc23f2949c69ea1c04212833d407e..29b6dae9f7b1f15085a197a8e94cb5dafda5d12a 100644 (file)
@@ -1284,6 +1284,23 @@ gdk_surface_x11_show (GdkSurface *surface, gboolean already_mapped)
     gdk_x11_surface_apply_fullscreen_mode (surface);
 }
 
+static void
+gdk_surface_x11_withdraw (GdkSurface *surface)
+{
+  if (!surface->destroyed)
+    {
+      if (GDK_SURFACE_IS_MAPPED (surface))
+        gdk_synthesize_surface_state (surface,
+                                     0,
+                                     GDK_SURFACE_STATE_WITHDRAWN);
+
+      g_assert (!GDK_SURFACE_IS_MAPPED (surface));
+
+      XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
+                       GDK_SURFACE_XID (surface), 0);
+    }
+}
+
 static void
 gdk_surface_x11_hide (GdkSurface *surface)
 {
@@ -1299,7 +1316,7 @@ gdk_surface_x11_hide (GdkSurface *surface)
     {
     case GDK_SURFACE_TOPLEVEL:
     case GDK_SURFACE_TEMP: /* ? */
-      gdk_surface_withdraw (surface);
+      gdk_surface_x11_withdraw (surface);
       return;
       
     case GDK_SURFACE_CHILD:
@@ -1313,23 +1330,6 @@ gdk_surface_x11_hide (GdkSurface *surface)
                GDK_SURFACE_XID (surface));
 }
 
-static void
-gdk_surface_x11_withdraw (GdkSurface *surface)
-{
-  if (!surface->destroyed)
-    {
-      if (GDK_SURFACE_IS_MAPPED (surface))
-        gdk_synthesize_surface_state (surface,
-                                     0,
-                                     GDK_SURFACE_STATE_WITHDRAWN);
-
-      g_assert (!GDK_SURFACE_IS_MAPPED (surface));
-
-      XWithdrawWindow (GDK_SURFACE_XDISPLAY (surface),
-                       GDK_SURFACE_XID (surface), 0);
-    }
-}
-
 static inline void
 surface_x11_move (GdkSurface *surface,
                  gint       x,
index 03210d53deec8789bbed501eca16a8e9ab7a651a..295fbacee12d9a3d4bb9cbdbc5066ca942b497cc 100644 (file)
@@ -6293,7 +6293,7 @@ gtk_window_unmap (GtkWidget *widget)
   surface = _gtk_widget_get_surface (widget);
 
   GTK_WIDGET_CLASS (gtk_window_parent_class)->unmap (widget);
-  gdk_surface_withdraw (surface);
+  gdk_surface_hide (surface);
 
   while (priv->configure_request_count > 0)
     {